package com.atguigu.guli.service.edu.controller.admin;


import com.atguigu.guli.service.edu.entity.Teacher;
import com.atguigu.guli.service.edu.service.TeacherService;
import com.sun.org.apache.xpath.internal.operations.Bool;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 讲师 前端控制器
 * </p>
 *
 * @author atguigu
 * @since 2021-06-23
 */
@RestController
@RequestMapping("/edu/teacher")
public class AdminTeacherController {
    @Autowired
    TeacherService teacherService ;

    @GetMapping("list")
    public List<Teacher> listAll(){
        List<Teacher> list = teacherService.list();
        return list ;
    }

    @DeleteMapping("delete/{id}")
    public Boolean deletaById(@PathVariable("id") String id){
        return teacherService.removeById(id) ;
    }

}

